import {createRouter,createWebHashHistory} from "vue-router"
import befor from "./befor"

import Home from "@/pages/Home.vue"
const My = ()=>import("@/pages/My.vue")
const Message = ()=>import("@/pages/Message.vue")
const Shop = ()=>import("@/pages/Shop.vue")
const File = ()=>import("@/pages/File.vue")
const Detail = ()=>import("@/pages/Detail.vue")
const Login = () =>import("@/pages/login/Login.vue")
const Sing = () =>import("@/pages/login/Sing.vue")
const Pass = () => import("@/pages/login/Pass.vue")
const Person = ()=>import("@/pages/Person.vue")
const routes = [
  {
    path:"/home",
    name:"Home",
    component:Home,
  },
  {
    path:"/my",
    name:"My",
    component:My,
  },
  {
    path:"/shop",
    name:"Shop",
    component:Shop,
  },
  {
    path:"/message",
    name:"Message",
    component:Message,
  },
  {
    path : "/file",
    name : "File",
    component : File,
  },
  {
    path : "/detail",
    name : "Detail",
    component : Detail,
  },
  {
    path : "/login",
    name : "Login",
    component : Login,
  },
  {
    path : "/sing",
    name : "Sing",
    component : Sing,
  },
  {
    path:"/pass",
    name: "Pass",
    component : Pass,
    meat : {
      title : "忘记密码"
    }  
  },
  {
    path:"/",
    name:"Home",
    component : Home
  },{
    path : "/person",
    name : "Person",
    component : Person,
  }
]

const router = createRouter({
  history:createWebHashHistory(),
  linkActiveClass:"active",
  routes
})

router.beforeEach(befor)

export default router